package com.water.bs.service;

import com.water.bs.mapper.UserMapper;
import com.water.bs.pojo.Photo;
import com.water.bs.pojo.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service
public class UserService {
    @Autowired
    private UserMapper userMapper;

//    public List<User> queryAllUser(){
//        return userMapper.queryAllUser();
//    }

    public User getUserById(String id){
        return userMapper.getUserById(id);
    }

    public int isPhoneRepeat(String phone){return userMapper.isPhoneRepeat(phone);}

    public int isEmailRepeat(String email){return userMapper.isEmailRepeat(email);}

    public int savePhoto(Map<String,Object> photoMap){return userMapper.savePhoto(photoMap);}

    public User login(Map<String,Object> map){return userMapper.login(map);}

    public Photo getPhoto(String userid){return userMapper.getPhoto(userid);}

    public int addUser(Map<String,Object> map){ //注册
        return userMapper.addUser(map);
    }

    public int updateUser(Map<String,Object> map){
        return userMapper.updateUser(map);
    }

    public int deleteUser(String id){
        return userMapper.deleteUser(id);
    }

    public User getUserHead(String id){
        return userMapper.getUserHead(id);
    }

    public int saveUserHead(Map<String,Object> map){
        return userMapper.saveUserHead(map);
    }

    public List<Map<String,Object>> genderList(){return userMapper.genderList();}

    public List<Map<String,Object>> sevenGiftHistory(Long nowDate){return userMapper.sevenGiftHistory(nowDate);}

    public  Map<String,Object> changeInfoCount(){return userMapper.changeInfoCount();}

    public  Map<String,Object> userCount(){return userMapper.userCount();}
    public  Map<String,Object> orgCount(){return userMapper.orgCount();}
    public  Map<String,Object> changeTimeCount(){return userMapper.changeTimeCount();}

    public Map<String,Object> userData(String userid){return userMapper.userData(userid);}

    public  int forgetPwd(Map<String,Object> map){return userMapper.forgetPwd(map);}

}
